

<div id="parentdiv">
<input type="text" id="parent" size="100"  class="ui-autocomplete-input ui-corner-all" autocomplete="on" value="<?=getObjByKey("portal_objects","lib_$LANG","id",$currentObject->parentid) ?>"/>
<input type="hidden" id="x_parentId" name="ButterflyPortal_data_PARENTID" value="<?=$currentObject->parentid ?>"/>
</div>
<script type="text/javascript">
//$(document).ready(function() {});
  $(function() {

 
    $( "#parent" ).autocomplete({
      minLength: 0,
      source: '/portlet.php?app=system&operation=getparentmenu',
     
      select: function( event, ui ) {
        $( "#parent" ).val( ui.item.label );
        $( "#x_parentId" ).val( ui.item.value );
 
        return false;
      }
    });

    $( "#parent" ).change(function() {
    	$( "#x_parentId" ).val("{novalue}");  
    });



    
  
  });

$("#el_PARENTID").html($("#parentdiv"));
</script>


